package com.zht.demo;


import javax.print.attribute.standard.PresentationDirection;
import java.sql.PreparedStatement;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class 组织结构代码映射 {
    public static void main(String[] args) {
        String njt = "640402360000\n" +
                "640125130000\n" +
                "640501160000\n" +
                "640422310000\n" +
                "640424160000\n" +
                "640103120000\n" +
                "640102170000\n" +
                "640111150000\n" +
                "640103160000\n" +
                "640202150000\n" +
                "640203150000\n" +
                "640221290000\n" +
                "640381330000\n" +
                "640402310000\n" +
                "640121190000\n" +
                "640422190000\n" +
                "640423180000\n" +
                "640121200000\n" +
                "640501200000\n" +
                "640503280000\n" +
                "640424190000\n" +
                "640502320000\n" +
                "640503370000\n" +
                "640422180000\n" +
                "640121240000\n" +
                "640203230000\n" +
                "640203130000\n" +
                "640423370000\n" +
                "640125210000\n" +
                "640502150000\n" +
                "640323200000\n" +
                "640302400000\n" +
                "640302340000\n" +
                "640503180000\n" +
                "640323140000\n" +
                "640111160000\n" +
                "640502170000\n" +
                "640402140000\n" +
                "640424130000\n" +
                "640203120000\n" +
                "640502160000\n" +
                "640324180000\n" +
                "640122250000\n" +
                "640121220000\n" +
                "640381170000\n" +
                "640501270000\n" +
                "640402230000\n" +
                "640103110000\n" +
                "640125120000\n" +
                "640202190000\n" +
                "640399070000\n" +
                "640323150000\n" +
                "640503260000\n" +
                "640102180000\n" +
                "640302180000\n" +
                "640422250000\n" +
                "640422270000\n" +
                "640424180000\n" +
                "640423320000\n" +
                "640381230000\n" +
                "640381180000\n" +
                "640501130000\n" +
                "640423200000\n" +
                "640103130000\n" +
                "640502130000\n" +
                "640501250000\n" +
                "640121170000\n" +
                "640102190000\n" +
                "640381210000\n" +
                "640103140000\n" +
                "640423280000\n" +
                "640425200000\n" +
                "640402150000\n" +
                "640102260000\n" +
                "640503150000\n" +
                "640323170000\n" +
                "640399170000\n" +
                "640122140000\n" +
                "640102210000\n" +
                "640102340000\n" +
                "640102280000\n" +
                "640102220000\n" +
                "640122280000\n" +
                "640103240000\n" +
                "640125160000\n" +
                "640103150000\n" +
                "640103170000\n" +
                "640103250000\n" +
                "640111140000\n" +
                "640503340000\n" +
                "640122160000\n" +
                "640125200000\n" +
                "640111130000\n" +
                "640121160000\n" +
                "640102150000\n" +
                "640198110000\n" +
                "640196180000\n" +
                "640202240000\n" +
                "640203160000\n" +
                "640203180000\n" +
                "640203200000\n" +
                "640203210000\n" +
                "640203140000\n" +
                "640203240000\n" +
                "640202200000\n" +
                "640202210000\n" +
                "640203250000\n" +
                "640221230000\n" +
                "640221160000\n" +
                "640221250000\n" +
                "640221210000\n" +
                "640221300000\n" +
                "640203290000\n" +
                "640205080000\n" +
                "640125250000\n" +
                "640125150000\n" +
                "640203190000\n" +
                "640221190000\n" +
                "640202160000\n" +
                "640203220000\n" +
                "640204110000\n" +
                "640204100000\n" +
                "640205070000\n" +
                "640302210000\n" +
                "640302220000\n" +
                "640221170000\n" +
                "640323160000\n" +
                "640302260000\n" +
                "640221220000\n" +
                "640302200000\n" +
                "640324220000\n" +
                "640381220000\n" +
                "640381250000\n" +
                "640324150000\n" +
                "640324360000\n" +
                "640324230000\n" +
                "640302390000\n" +
                "640323230000\n" +
                "640324200000\n" +
                "640324340000\n" +
                "640221360000\n" +
                "640323130000\n" +
                "640381190000\n" +
                "640381240000\n" +
                "640302240000\n" +
                "640302350000\n" +
                "640323180000\n" +
                "640399100000\n" +
                "640381310000\n" +
                "640324160000\n" +
                "640402160000\n" +
                "640399160000\n" +
                "640402210000\n" +
                "640402250000\n" +
                "640402180000\n" +
                "640402340000\n" +
                "640402200000\n" +
                "640381320000\n" +
                "640324170000\n" +
                "640324190000\n" +
                "640324270000\n" +
                "640399080000\n" +
                "640102250000\n" +
                "640402240000\n" +
                "640402280000\n" +
                "640403100000\n" +
                "640422130000\n" +
                "640422220000\n" +
                "640422280000\n" +
                "640423270000\n" +
                "640422160000\n" +
                "640422150000\n" +
                "640422260000\n" +
                "640422200000\n" +
                "640422290000\n" +
                "640422230000\n" +
                "640423160000\n" +
                "640422240000\n" +
                "640422350000\n" +
                "640423250000\n" +
                "640102240000\n" +
                "640422210000\n" +
                "640402330000\n" +
                "640422300000\n" +
                "640423240000\n" +
                "640423300000\n" +
                "640423260000\n" +
                "640423350000\n" +
                "640423210000\n" +
                "640425310000\n" +
                "640423230000\n" +
                "640424200000\n" +
                "640426060000\n" +
                "640426070000\n" +
                "640426080000\n" +
                "640426090000\n" +
                "640426100000\n" +
                "640425230000\n" +
                "640425290000\n" +
                "640425340000\n" +
                "640425270000\n" +
                "640425170000\n" +
                "640424170000\n" +
                "640425260000\n" +
                "640427060000\n" +
                "640424140000\n" +
                "640424150000\n" +
                "640381150000\n" +
                "640425240000\n" +
                "640425160000\n" +
                "640221200000\n" +
                "640502310000\n" +
                "640425190000\n" +
                "640501180000\n" +
                "640502190000\n" +
                "640503310000\n" +
                "640503190000\n" +
                "640122150000\n" +
                "640402170000\n" +
                "640501230000\n" +
                "640402260000\n" +
                "640501240000\n" +
                "640501190000\n" +
                "640501150000\n" +
                "640502220000\n" +
                "640501170000\n" +
                "640502180000\n" +
                "640502140000\n" +
                "640503170000\n" +
                "640503360000\n" +
                "640503270000\n" +
                "640503010500\n" +
                "640302190000\n" +
                "640402290000\n" +
                "640503210000\n" +
                "640503220000\n" +
                "640503250000\n" +
                "640202140000\n" +
                "640111110000\n" +
                "640102120000\n" +
                "640111170000\n" +
                "640503350000\n" +
                "640125170000\n" +
                "640199060000\n" +
                "640102130000\n" +
                "640121180000\n" +
                "640503330000\n" +
                "640399090000\n" +
                "640203170000\n" +
                "640503240000\n" +
                "640403090000\n" +
                "640302230000\n" +
                "640111120000\n" +
                "640102290000\n" +
                "640202270000\n" +
                "640323190000\n" +
                "640122180000\n" +
                "640502230000\n" +
                "640382070000\n" +
                "640202130000\n" +
                "640196170000\n" +
                "640122170000\n" +
                "640111180000\n" +
                "640422320000\n" +
                "640125180000\n" +
                "640381160000\n" +
                "640425300000\n" +
                "640425250000\n" +
                "640422170000\n" +
                "640102230000\n" +
                "640202180000\n" +
                "640125140000\n" +
                "640102160000\n" +
                "640502250000\n" +
                "640102270000\n" +
                "640121270000\n" +
                "640102140000\n" +
                "640502200000\n" +
                "640501140000\n" +
                "640102110000\n" ;

        String replace = njt.replace("\n", ",");
        if (replace.endsWith(",")){
            replace = replace.substring(0,replace.length() -1);
        }
        System.out.println(replace);


        List<Integer> list1 = Arrays.asList(111,222,333,444);
        List<Integer> list2 = Arrays.asList(111,222,333,555);
        // 结果集合
        Set<Integer> resIntegers = new HashSet<>();
        // 将第一个集合转成set
        Set<Integer> set1 = new HashSet<>();
        set1.addAll(list1);
        for (Integer element : list2) {
            if (set1.contains(element)){
                resIntegers.add(element);
            }
        }
        System.out.println(resIntegers);

    }
}
